#include "e2d/core/fui/components.h"
#include "e2d/core/Entity.h"

using namespace e2d::fui;

std::vector<std::string> Components::m_Labels= {
    e2d::ComboBox::_Label_(),
    e2d::PushButton::_Label_(),
    e2d::RadioButton::_Label_(),
    e2d::LineEdit::_Label_(),
    e2d::Slider::_Label_(),
    e2d::PlainLineEdit::_Label_()
   };

bool Components::AddComponent(e2d::Entity* entity,const  ComponentType& type)
{
    bool flag{ 0 };
    flag |= entity->AddComponentFromType<e2d::ComboBox>(type);
    flag |= entity->AddComponentFromType<e2d::PushButton>(type);
    flag |= entity->AddComponentFromType<e2d::RadioButton>(type);
    flag |= entity->AddComponentFromType<e2d::LineEdit>(type);
    flag |= entity->AddComponentFromType<e2d::Slider>(type);
    flag |= entity->AddComponentFromType<e2d::PlainLineEdit>(type);
    
    return flag;
}

bool Components::CopyComponents(const e2d::Entity* source, e2d::Entity* target)
{
    bool flag{0};

    flag|=target->CopyComponent<e2d::ComboBox>(source);
    flag|=target->CopyComponent<e2d::PushButton>(source);
    flag|=target->CopyComponent<e2d::RadioButton>(source);
    flag|=target->CopyComponent<e2d::LineEdit>(source);
    flag|=target->CopyComponent<e2d::Slider>(source);
    flag|=target->CopyComponent<e2d::PlainLineEdit>(source);

    return flag;
}
